package com.ai.entity.file;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;

/**
 * @Author：xiaosheng
 * @Date：2024/6/26 10:50
 */

@TableName("t_chunk")
@Data
@ApiModel(value = "文件块", description = "文件块")
public class ChunkEntity {

    /**
     * 主键ID
     */
    @TableId(value = "id",type = IdType.AUTO)
    @ApiModelProperty(value = "主键ID")
    private String id;
    /**
     * 文件块编号，从1开始
     */
    @ApiModelProperty(value = "文件块编号，从1开始")
    private Integer chunkNumber;
    /**
     * 每块大小
     */
    @ApiModelProperty(value = "每块大小")
    private Long chunkSize;
    /**
     * 当前分块大小
     */
    @ApiModelProperty(value = "当前分块大小")
    private Long currentChunkSize;
    /**
     * 总大小
     */
    @ApiModelProperty(value = "总大小")
    private Long totalSize;
    /**
     * 文件标识MD5
     */
    @ApiModelProperty(value = "文件标识MD5")
    private String identifier;
    /**
     * 文件名
     */
    @ApiModelProperty(value = "文件名")
    private String filename;
    /**
     * 总块数
     */
    @ApiModelProperty(value = "总块数")
    private Integer totalChunks;

    /**
     * 块内容
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "块内容")
    private MultipartFile upfile;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;


    @ApiModelProperty(value = "创建人")
    private String createUser;



}